package com.ethink.order.facadeImpl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.TocSaleReturnImportLogFacade;
import com.ethink.order.api.info.TocSaleReturnImportLogDetailInfo;
import com.ethink.order.api.model.TocSaleReturnImportModel;
import com.ethink.order.api.request.TocSaleReturnImportLogAddRequest;
import com.ethink.order.api.request.TocSaleReturnImportLogQueryRequest;
import com.ethink.order.api.request.UpdateStatusBaseRequest;
import com.ethink.order.api.response.TocSaleReturnImportLogDetailResponse;
import com.ethink.order.manager.SaleChannelRequestManager;
import com.ethink.order.service.TocSaleReturnImportLogDetailService;
import com.ethink.order.service.TocSaleReturnImportLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TOC销售退单导入日志 Facade接口实现
 *
 * @author default
 * @date 2022-12-16
 */
@RestController
@Slf4j
@RequestMapping("order-service/facade/v1/tocSaleReturnImportLog")
public class TocSaleReturnImportLogFacadeImpl implements TocSaleReturnImportLogFacade {

    @Autowired
    private TocSaleReturnImportLogService tocSaleReturnImportLogService;

    @Autowired
    private TocSaleReturnImportLogDetailService tocSaleReturnImportLogDetailService;

    @Override
    public Integer add(TocSaleReturnImportLogAddRequest request) {
        return tocSaleReturnImportLogService.add(request);
    }

    @Override
    public Page<TocSaleReturnImportModel> pageQuery(TocSaleReturnImportLogQueryRequest request) {
        SaleChannelRequestManager.fill(request,0,1,2);
        return tocSaleReturnImportLogService.pageQuery(request);
    }

    @Override
    public Integer delete(Long id) {
        return tocSaleReturnImportLogService.delete(id);
    }

    @Override
    public TocSaleReturnImportLogDetailResponse queryDetail(Long id) {
        return tocSaleReturnImportLogService.queryDetail(id);
    }

    @Override
    public Integer updateStatus(UpdateStatusBaseRequest request) {
        return tocSaleReturnImportLogService.updateStatus(request);
    }

    @Override
    public List<TocSaleReturnImportLogDetailInfo> queryDetailByShopOrderNoList(List<String> shopOrderNoList) {
        return tocSaleReturnImportLogDetailService.queryDetailByShopOrderNoList(shopOrderNoList);
    }


}